Typesetting User Dialogues and Workspaces

The above examples demonstrate the usefulness of the six basic document elements we provide. Besides being useful on their own, we can combine them to form higher level units. In the current version of the APL front end, support for typesetting a dialogue and an APL workspace listing is included.

A dialogue is a pair of user input and interpreter response. We typeset the user input as an APL expression and the interpreter response as an APL array. The dialogue


\begin{APLbold}\begin{APLexpr}
\APLleftparen\APLone\APLleftparen\APLtwo\APLspace
\APLthree\APLrightparen\APLfour
\end{APLexpr}\end{APLbold}

\begin{APLarray}
\leavevmode\hbox to 1.2em{\hss\APLS\hss}\leavevmode\hbox to 1.2...
...\hss}\leavevmode\hbox to 1.2em{\hss\APLupcaret\hss}
\APLspace\par
\end{APLarray}

was generated by entering the following APL expression


\begin{APLbold}\begin{APLexpr}
\APLquote\APLE\APLquote\APLspace\APLP
\APLR\APLT\...
...Lspace
\APLthree\APLrightparen\APLfour\APLbr\APLquote
\end{APLexpr}\end{APLbold}

Hopefully, most of the dialogues will not result in a syntax error as the above one. But automatically typesetting examples with errors is very convenient for describing APL's error trapping mechanisms in a text book.

An example for the printout of an APL workspace would be too space-consuming to be included here. It basically is implemented by combining the printout of arrays, functions and operators intertwined with LATEX sectioning commands. LATEX's table of contents considerably increases the utility of a workspace listing.